﻿using System;
using System.ServiceModel;

namespace XchangeStreamer.Core
{
    [MessageContract]
    public sealed class Message
    {
        #region Public Properties

        [MessageHeader(Namespace = XchangeStreamer.Utilities.Settings.Namespace)]
        public int TopicId
        {
            get;
            set;
        }

        [MessageBodyMember(Order = 1, Namespace = XchangeStreamer.Utilities.Settings.Namespace)]
        public int MessageId
        {
            get;
            set;
        }

        [MessageBodyMember(Order = 2, Namespace = XchangeStreamer.Utilities.Settings.Namespace)]
        public TimeSpan Time
        {
            get;
            set;
        }

        [MessageBodyMember(Order = 3, Namespace = XchangeStreamer.Utilities.Settings.Namespace)]
        public byte IsCompressed
        {
            get;
            set;
        }

        [MessageBodyMember(Order = 4, Namespace = XchangeStreamer.Utilities.Settings.Namespace)]
        public byte[] Content
        {
            get;
            set;
        }

        #endregion
    }
}
